﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace WindowsGame1
{
    static class SceneManager
    {
        
        private static SceneBase current;
        
        public static void setScene(SceneBase scene)
        {
            if (current != null)
                current.terminate();

            current = scene;

            if (current != null)
                current.start();
        }

        public static bool update()
        {
            if (current == null)
            {
                return false;
            }
            else
            {
                current.update();
                return true;
            }

        }

        public static bool draw(SpriteBatch spriteBatch)
        {
            if (current == null)
            {
                return false;
            }
            else
            {
                
                current.draw(spriteBatch);
                return true;
            }
        }



    }
}
